﻿using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Resources;
using C1.Silverlight.Pdf;
using MyFloridaHouse.libSvUtilities.Logging;

namespace MyFloridaHouse.libSvOpenDistricts.PDF
{
    public static class HouseMapSeal
    {
        public static void Draw(C1PdfDocument pdf, PDFPoint cursor, double borderWidth, double borderHeight)
        {
            // draw border 
            //Pen logoPen = new Pen(Colors.Black, 1.0);
            //pdf.DrawRectangle(logoPen, new Rect(cursor.x, cursor.y, borderWidth, borderHeight));

            // draw image
            Rect logoImageRect = new Rect(cursor.x, cursor.y, borderWidth, borderHeight);
            StreamResourceInfo sri = Application.GetResourceStream(new Uri("/libSvOpenDistricts;component/Images/HouseSeal.png", UriKind.Relative));
            if (null == sri)
            {
                Log.NotifyUser("Unable to find image of House Seal for Footer");
            }
            else
            {
                BitmapSource source = new BitmapImage(); source.SetSource(sri.Stream);
                WriteableBitmap houseIcon = new WriteableBitmap(source);
                pdf.DrawImage(houseIcon, logoImageRect);
            }

        }
    }
}
